Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 848514ec5492e62c2bc5f8a5964c9fb9c7bd96b9


Parents : 3a4d7ee
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-09-25T15:47:42+02:00

Fixed potential None reference

Changes

1 files changed, 6 insertions(+), 2 deletions(-)


Diff

diff --git a/nomadnet/ui/textui/Browser.py b/nomadnet/ui/textui/Browser.py
index edc8ca2..7593b99 100644
--- a/nomadnet/ui/textui/Browser.py
+++ b/nomadnet/ui/textui/Browser.py
@@ -203,7 +203,11 @@ class Browser:
else:
self.display_widget.set_attr_map({None: "body_text"})
self.browser_header = self.make_control_widget()
- remote_display_string = self.app.directory.simplest_display_str(self.destination_hash)
+ if self.destination_hash != None:
+ remote_display_string = self.app.directory.simplest_display_str(self.destination_hash)
+ else:
+ remote_display_string = ""
+
if self.loopback != None and remote_display_string == RNS.prettyhexrep(self.loopback):
remote_display_string = self.app.node.name
@@ -878,4 +882,4 @@ class UrlEdit(urwid.Edit):
if key == "enter":
self.confirmed(self)
else:
- return super(UrlEdit, self).keypress(size, key)
\ No newline at end of file
+ return super(UrlEdit, self).keypress(size, key)
\ No newline at end of file


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────